package com.kcht.sylyg08.dao.impl;

import com.kcht.adp.common.log.Logger;
import com.kcht.sylyg08.dao.DataSourceBaseDao;
import com.kcht.sylyg08.dao.IOutGoingPoolDao;
import com.kcth.sylyg08.entity.OutGoingPool;

import javax.ejb.Singleton;
import javax.ejb.Startup;
import javax.inject.Inject;

/**
  *
  * @Package:        com.kcht.sylyg08.dao.impl
  * @Description:     java类作用描述
  * @Author:         lenovo
  * @CreateDate:     2019/5/15 14:07
 */
@Singleton
@Startup
public class OutGoingPoolDao extends DataSourceBaseDao<OutGoingPool, Long> implements IOutGoingPoolDao {
    @Inject
    private Logger log;

    @Override
    public Integer getCountByMaterial(String material) {
        return this.selectOneBySQL("select count from t_syly_outgoingpool where material=" + material, Integer.class);
    }

    @Override
    public OutGoingPool getByMaterial(String material) {
        return this.selectOneByJPQL("select a from OutGoingPool a where a.material = ?", material);
    }
}
